Import('env')

env.Slice2cpp(target = 'FileServer', source = 'slice/FileServer.ice')
env.Slice2cpp(target = 'InfoService', source = 'slice/InfoService.ice')
env.Slice2cpp(target = 'Maxima', source = 'slice/Maxima.ice')
env.Slice2cpp(target = 'Security', source = 'slice/Security.ice')

NodeLibSource = File(['ServantLocator.cc', 'Security.cc', 'AccessDeniedServant.cc',
    'Node.cc', 'InfoService.cc', 'Service.cc', 'ServiceContext.cc'])
MaximaServiceSource = File(['Maxima.cc', 'MaximaFactoryI.cc', 'MaximaResourceI.cc',
    'FileServerImpl.cc', 'MasterFactoryI.cc', 'FileServer.cc'])

maximaInstance = env.SharedObject(target = 'MaximaInstance',
    source = '#src/MaximaAPI/MaximaInstance.cc')

nodeLib = env.SharedLibrary(target = "IARnet", source = [NodeLibSource],
    CPPDEFINES = 'NODEDLL')
env.MyInstall('/lib/', nodeLib)

env.MyInstall('/bin/', env.Program(target = "node", source = ['main.cc'],
    LIBS = [nodeLib, env['LIBS']]))

env.MyInstall('/lib/', env.SharedLibrary(target = 'MaximaService',
    source = [maximaInstance, MaximaServiceSource], LIBS = [nodeLib,
    env['LIBS'], 'boost_regex-mt', 'boost_filesystem-mt', 'boost_system-mt']))

env.MyInstall('/include/IARnet/', ['AccessDeniedServant.h', 'Node.h', 'portdefs.h',
    'ServantLocator.h', 'Service.h', 'ServiceContext.h', 'SOExportDefs.h'])

env.SConscript('examples/SConscript', exports = 'env')

